package com.tnsw.facebookautoliker.helper.command;

import java.util.List;

import android.content.Context;
import android.util.Log;

import com.facebook.LoggingBehavior;
import com.facebook.Request;
import com.facebook.Response;
import com.facebook.Session;
import com.facebook.Settings;
import com.facebook.model.GraphUser;
import com.tnsw.coreutils.MyLog;
import com.tnsw.facebookautoliker.helper.FacebookBGManager;
import com.tnsw.facebookautoliker.helper.FacebookCommandObject;
import com.tnsw.facebookautoliker.helper.GeneralManager;
import com.tnsw.facebookautoliker.helper.TestFBAction2;

public class RefreshFriendsList extends FacebookCommandObject {

	private RefreshFriendsList self;
	private int friendCount;
	
	public RefreshFriendsList(Context context, int friendCount) {
		super(context);
		this.tag = "RefreshFriendsList";
		this.self = this;
		this.friendCount = friendCount;
		this.setChildrenCommandCount(friendCount);
	}
	
	@Override
	public void execute() {
		super.execute();
		
		/*
		Settings.addLoggingBehavior(LoggingBehavior.REQUESTS);
		Session session = Session.openActiveSessionFromCache(this.context);
		if (session != null) {
			
			Request.executeMyFriendsRequestAsync(session, new Request.GraphUserListCallback() {
				
				@Override
				public void onCompleted(List<GraphUser> users, Response response) {
					Log.d(tag, "friendcount=" + users.size());
					int i = 0;
					MyLog.d(tag, "friends count=" + users.size());
					FacebookBGManager fbm = FacebookBGManager.getInstance(context);
					fbm.updateCommandStatus(self, 200, null);
					for (GraphUser user : users) {

						i += 1;
						
					}
					
				}
			});			
		}
		*/	
	}

}
